home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
utility
/
utilcli
/
execthck.lha
/
executehack.readme
< prev
next >
Wrap
Text File
|
1996-12-28
|
2KB
|
62 lines
Short: V1.3 Hack to make Execute recognize #!
Type: util/cli
Uploader: pueschel@imsdd.meb.uni-bonn.de
Author: pueschel@imsdd.meb.uni-bonn.de
The Execute Hack:
This is a little hack that makes the execute command recognize
the #! convention in script files. This means: if a script file
starts with, say "#!/bin/sh", as the first line, my Execute
will run sh as an interpreter on the file. All you have to do
is set the s-flag on the script, and it can be used like other
Amiga-OS scripts.
Installation:
Rename c:Execute to C:Execute.orig (it is called by my Execute for
amiga shell scripts).
Copy my Execute to c: (it can be made resident, like the original).
That's all :-)
Use:
Set the s-flag on all sh, csh, perl or whatever-you-use scripts.
That's it. You do not even need to change the paths in the script
files:
#!/usr/bin/perl
#!/usr/local/bin/perl
#!/foo/bar/perl
#! perl
are all equivalent. My execute strips the path from the interpreter
name and searches the resident list and the Amiga-OS path for the
command.
The complete invocation (e.g. perl -i blabla) is set as CLI command
name.
Problems & History:
The original Execute apparently does not use ReadArgs(), so my Execute
does not react exactly the same way when an error occurs.
The first release did not search for scripts, like the original Execute
does. Fixed.
The last component of the search path was ignored. Fixed. Thanks to Gunther
Nikl for the report.
AmigaDOS style paths in the #! line, like #!bin:sh, did not work. Fixed.
Spaces between #! and interpreter name were not properly ignored. Fixed.
Legal Stuff:
There is no warranty. The program is Freeware.
Bug reports & suggestions:
Send bug reports & suggestions to pueschel@imsdd.meb.uni-bonn.de.